<!--<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>地理采集信息数据修改页</title>-->
#@layout()

#define css()

<!--全局样式-->
<style type="text/css">
    body {
        background-image: url(http://47.105.208.60:8080/wechat-api/images/loginbg.png);
        background-position: center center;
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-size: cover;
    }

    form#index {
        margin-left: auto;
        margin-right: auto;
        max-width: 500px;
        background: #F7F7F7;
        opacity: 0.95;
        padding: 25px 15px 25px 10px;
        font: 12px Georgia, "Times New Roman", Times, serif;
        color: #888;
        text-shadow: 1px 1px 1px #FFF;
        border: 1px solid #E4E4E4;
        text-align: center;
    }

    form#index h3 {
        font-size: 25px;
        padding: 0px 0px 10px 40px;
        display: block;
        border-bottom: 1px solid #E4E4E4;
        margin: -10px -15px 30px -10px;;
        color: #888;
        text-align: center;
    }

    form#index label {
        display: block;
        margin: 0px;
    }

    form#index label > span {
        float: left;
        width: 20%;
        text-align: right;
        padding-right: 10px;
        margin-top: 10px;
        color: #888;
    }

    form#index input[type="text"], form#index input[type="number"] {
        border: 1px solid #DADADA;
        color: #888;
        height: 30px;
        margin-bottom: 16px;
        margin-right: 6px;
        margin-top: 2px;
        outline: 0 none;
        padding: 3px 3px 3px 5px;
        width: 70%;
        font-size: 12px;
        line-height: 15px;
        box-shadow: inset 0px 1px 4px #ECECEC;
        -moz-box-shadow: inset 0px 1px 4px #ECECEC;
        -webkit-box-shadow: inset 0px 1px 4px #ECECEC;
    }

    form#index .button {
        background: #E27575;
        border: none;
        padding: 10px 25px 10px 25px;
        color: #FFF;
        box-shadow: 1px 1px 5px #B6B6B6;
        border-radius: 3px;
        text-shadow: 1px 1px 1px #9E3F3F;
        cursor: pointer;
    }

    .isAll {
        position: relative;
        z-index: 1;
        display: flex;
        align-content: center;
        justify-content: space-between;
        width: 94%;
        margin: 0 3%;
    }

    .divForm {
        position: absolute;
        z-index: 2;
        width: 95%;
    }

</style>
#end
<!--</head>
<body>-->

#define script()
<script>
    $.ajax({
        url: "http://47.105.208.60:8080/wechat-api/category/findGame",
        //url: "http://localhost:8080/wechat-api/category/findGame",
        type: 'get',
        datatype: 'json',
        success: function (data) {
            if (data.code == 0) {
                var msg = data.info;
                $(msg).each(function () {
                    var html = "<option value='" + this.id + "'>" + this.title + "</option>"
                    $("select").append($(html));
                })

            }

        }, error: function (err) {
            console.log("----------")
            console.log(err)
        }
    });

    function upload() {
        window.open("/admin/shoot/upload1", "newwindow123", "height=550, width=950, top=100, left=200, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no")
    }

    function select() {
        var realname = document.getElementById("realname").value;
        window.open("/admin/shoot/select?realname=" + realname, "newwindow123", "height=550, width=950, top=100, left=200, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no")

    }
    function add() {
        var nickname = document.getElementById("name").value;
        $.ajax({
            url: "http://localhost:8080/wechat-api/api/save?nickname=" + nickname,
            type: 'get',
            datatype: 'json',
            success: function (data) {
                if (data.code == 0) {
                    alert("添加成功");

                }

            }, error: function (err) {
                console.log("----------")
                console.log(err)
            }
        });

    }
    $("form").submit(function(){
        $.ajax({
            //url: "http://47.105.208.60:8080/wechat-api/Blind_date/addCertificate",
            type:"post",
            url:"http://localhost:8080/wechat-api/shoot/upload1",
            data:$("form").serialize(),
            dataType:"json",
            success:function(data) {
                if(data.code == 0) {
                    alert("成功");
                    window.location.reload();
                    window.close();
                } else {
                    alert(data.info);
                }
            },
            error:function (data) {
                alert(data.code);
            }
        })
    })
</script>
#end

#define content()
<div class="isAll content-wrapper">
    <div class="divForm" style="margin-left: 500px">
        <h3 style="align-content: center">作品上传</h3>
        <table>
            <input type="text" id="realname" class="realname" name="realname"/>
            <button onclick="select()">选择作者</button>

            <input type="text" id="name" class="name" name="name"/>
            <button onclick="add()">添加作者</button>

            <form id="index" onsubmit="return false" action="##" method="post" class="form1">


                <tr>
                    <label>
                        <td><span>作者名称: </span></td>
                        <td><input type="text" id="nickname"></td>
                        <input type="hidden" id="id" name="id">
                    </label>
                </tr>
                <tr>
                    <label>
                        <td><span>参加赛事:</span></td>
                        <td><select name="gId">
                            <option>请选择赛事</option>

                        </select></td>
                    </label>
                </tr>
                <tr>
                    <label>
                        <td><span>参赛作品标题:</span></td>
                        <td><input type="text" name="title" placeholder="请输入标题"></td>
                    </label>
                </tr>
                <tr>
                    <label>
                        <td><span>参赛作品介绍:</span></td>
                        <td><input type="text" name="content" placeholder="请输入作品介绍"></td>
                    </label>
                </tr>
                <tr>
                    <br>
                    <label>
                        <td><span>作品拍摄地点:</span></td>
                        <td><input type="text" name="site" placeholder="请输入拍摄地点"></td>
                    </label>
                </tr>
                <tr>
                    <label>
                        <td><input type="hidden" id="path" name="path" /></td>
                        <td>
                            <input type="button" onclick="upload()" value="作品上传">
                            <!--<button onclick="upload()">作品上传</button>-->
                        </td>

                    </label>
                </tr>
                <br />
                <br />
                <br />
                <br />

                <tr>
                    <label>
                        <td>
                            <input type="submit" value="提交"/>
                        </td>

                    </label>
                </tr>
            </form>
        </table>

    </div>

</div>
#end

